% % File		:	verity/ppg_0_1_display
% % Description	:   for Heart Rate Algorithm
% % Fuction		:	PPG signal display
% % Author		:	@hiyangdong
% % Version		:	V0.1
% % Time		:	12 Jan. 2016

%{
 1.0.1 read data and orignal calculate
%}
% close all
% clear all

ExcelName = 'ppg_RawData.xlsx';

data_type = 8;
data_sheet_max = 14;
time_length = 60;
data_length  = time_length * 100;

data.all = zeros(data_type,data_length,data_sheet_max);

for i = 1:data_sheet_max
    for j = 1:data_type
        xlRange_code = ['A'+j-1,':','A'+j-1];
        xlRange = char(xlRange_code);
        data.all(j,:,i) = xlsread(ExcelName,i,xlRange);
    end
end

num_data = data.all(1,:,ExcelSheet);
ppg_data = data.all(2,:,ExcelSheet);
ppg_data = ppg_data -mean(ppg_data);
gyro.x   = data.all(3,:,ExcelSheet);
gyro.y   = data.all(4,:,ExcelSheet);
gyro.z   = data.all(5,:,ExcelSheet);
acce.x   = data.all(6,:,ExcelSheet);
acce.y   = data.all(7,:,ExcelSheet);
acce.z   = data.all(8,:,ExcelSheet);

mat_filename = 'ppg_RawData.mat';
save(mat_filename);

disp('end');